package entities;

import play.db.ebean.Model;

import javax.persistence.*;

import java.io.Serializable;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: eagami
 * Date: 01/12/13
 * Time: 00:33
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name="Reader")
@SequenceGenerator(name="Reader_sequence")
public class Reader extends Model implements Serializable{


	/**
	 * 
	 */
	private static final long serialVersionUID = 8315094978358606428L;

    @Id
    @Column(name = "Reader_id")
	private Long id;
	private Integer number;
	private Integer locationX;
    private Integer locationY;


    public static Finder<Long,Reader> find = new Finder<Long,Reader>(
            Long.class, Reader.class
    );


   public Reader() {
	// TODO Auto-generated constructor stub
}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name="number",unique=false,length=20,nullable=true)
	public Integer getNumber() {
		return number;
	}

	public void setNumber(Integer number) {
		this.number = number;
	}

	@Column(name="Location_X",unique=false,length=20,nullable=true)
	public Integer getLocationX() {
		return locationX;
	}

	public void setLocationX(Integer locationX) {
		this.locationX = locationX;
	}

	@Column(name="Location_Y",unique=false,length=20,nullable=true)
	public Integer getLocationY() {
		return locationY;
	}

	public void setLocationY(Integer locationY) {
		this.locationY = locationY;
	}

    @play.db.jpa.Transactional
    public static List<Reader> getAllReaders(){
        return Reader.find.all();
    }
}
